package AdapterPattern;

import java.io.*;
import java.util.*;

/**
 * 
 */
public class Client {

    /**
     * Default constructor
     */
    public Client() {
    }

    public static void main(String[] args) {
        System.out.println("适配器模式");
        BinarySearch binarySearch = new BinarySearch();

        DataOperation dataOperation = new DataOperationAdapter(new QuickSort(),new BinarySearch() );

        Integer[] array = {90,85,78,65,85,53,62,71,97};

        //使用binarySearch适配器
        dataOperation.search(array, 85);

        //使用QuickSort适配器
        dataOperation.sort(array);
    }
}